home *** CD-ROM | disk | FTP | other *** search
-
- ; -------------------------------------------------------------
- ; Simple file-reading example, with crude string parsing...
- ; -------------------------------------------------------------
- ; Uncommented version, to show how simple the code really is...
-
- Graphics 640, 480
-
- Color 150, 150, 200
- Text 0, 12, "Reading text from 'test.txt'..."
-
- info = ReadFile ("test.txt")
-
- If info
-
- y = 24
-
- Repeat
-
- a$ = ReadLine (info)
-
- Color 255, 255, 100
- Text 0, y, a$
-
- pos = Instr (a$, "Blitz")
-
- If pos
-
- x = StringWidth (Left (a$, pos - 1))
- Color 255, 0, 0
- Text x, y, "Blitz"
-
- EndIf
-
- y = y + 12
-
- Until Eof (info)
-
- CloseFile info
-
- Else
-
- RuntimeError "Failed to read test.txt! Aborting..."
-
- EndIf
-
- MouseWait
- End